home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / PublicDomain / Anwendungen / Miggy / Miggy.doc < prev    next >
Text File  |  1999-11-17  |  15KB  |  394 lines

  1. --------------------------------------------------------------------------
  2. Initial release by Olly 18-Nov-99
  3. --------------------------------------------------------------------------
  4.  
  5. Miggy - Yet another attempt at artificial intelligence :)
  6.  
  7.  
  8. PROGRAM HISTORY: (a must read!)
  9. ----------------
  10. Late '89 (<- True!)
  11.  
  12. Purchase of new A500, began with (Yuk!) AmigaBasic, started working with
  13. specific responses to user input.  After 15 mins coding, my brain
  14. subconciously calculated a large number beginning with 5 and many decimal
  15. places concerning the number of specific responses required before project
  16. completion.  Needless to say, scrapped!
  17.  
  18. Early '90
  19.  
  20. Changed coding language to ASM.
  21.  
  22. *Large time-warp here - Left Army in mid '95*
  23.  
  24. 11-05-99
  25.  
  26. After MANY projects and a BBS filebase (FB11 - Max's), I came across a
  27. project from Aminet called HAL9001 V1.42 by Simon Champion, written late
  28. '98 in Amos Pro.  His idea was a step forward, to output responses using a
  29. certain formula based on Nouns and Verbs.  Amos being a somewhat buggy and
  30. unstable language, I couldn't get it to reply a single sentence without
  31. crashing with a dead-end (80000006) alert every time, but it started me
  32. thinking.
  33.  
  34. 12-05-99
  35.  
  36. 24 hour thinktank.  Experimented with a few routines.  Input parser routine
  37. complete.  Working out file formats (preferably editable ASCII), basic
  38. program structure complete.  Can't sleep.
  39.  
  40. 13-05-99
  41.  
  42. Main problem with this kind of program is that 90% completion is required
  43. before first test can be established.  Ran a few tests - deemed fairly
  44. successful.  Did some more tweaking, doesn't crash randomly anymore :)
  45.  
  46. 14-05-99
  47.  
  48. Complete!  Miggy uses particular files based on mood and emotion, such as
  49. good and bad subject, happy and sad etc.  Words in dictionary require their
  50. own mood/emotion and meaning.  Responses gleaned from these facts.  Miggy
  51. has the ability to learn.  Responses randomly fetched once mood/emotion is
  52. determined.  Code pretty patched and messy though :(
  53.  
  54. Program upkeep difficult, as later stages of testing showed.  Program
  55. ability to learn hampered by requirement of many more moods/emotions than
  56. originally catered for.  Therefore, brain recalculates number - result much
  57. smaller this time, albeit still too large for practicality.  Especially
  58. when in "Learn" mode, too cumbersome to teach and too many variables based
  59. on what mood/meaning I myself deem a particular word to have and what
  60. someone else does.  Hmm..  Scrapped! (again)
  61.  
  62. 15-05-99
  63.  
  64. Major rethink.  Need to cut down on number of files used.  Also want to
  65. cater for different languages, as I would like to see this program spread
  66. worldwide with users creating either their own or adding to existing
  67. files in their own language.  "Learn" mode must be simplistic, as users
  68. might tire of this and leave it alone.  Decided to keep input parsing
  69. routine as it worked fine. :þ  What kind of algorithm is required to
  70. calculate an appropriate response?  Is this the kind of thing that lonely
  71. people do?  Is this concept possible at all?  [sigh].. Still can't sleep.
  72.  
  73. 16-05-99
  74.  
  75. Some more experimentation with ideas and routines.  Major routines
  76. reworked completely to cater for file formats.  Attempting to maintain
  77. maximum speed for when datafiles grow large.  How many words in the English
  78. (or then again, any other) language?  65,535 should be enough, as most
  79. English dictionaries only contain about 30,000 or so.  Response parser
  80. EXTREMELY fast but has spurious problems I'm unable to pin down.  Memory
  81. requirements reduced massively (to 8848 bytes!) by slowing down response
  82. parser slightly.  Some more teeny bugs squished.
  83.  
  84. 17-05-99
  85.  
  86. Prettied up the output, tested some more.  Found another bug that was
  87. subsequently squished.  2 major sub-routines placed in-line to help
  88. fatter processors with instruction caches.  After more testing, determined
  89. that random response-fetch routine too hit and miss.  Replaced with smaller
  90. and more intelligent method.
  91.  
  92. Complete!  The fully reworked Miggy now works fine without any crashing or
  93. wierd binary output.  Fully customizable for most languages with minimal
  94. memory requirements.  Even with little data in files responses becoming
  95. intelligent.  Should work on Kick 1.3 machines as well (does 1.3 understand
  96. the assign "PROGDIR:"?  If not - assign it :)  Executable size under 2K.
  97.  
  98. ---------------------------------------------------------------------------
  99.  
  100. So now you know what this project is all about.  If you didn't read the
  101. program history, I strongly suggest you do so.  I'll stop typing in the
  102. meantime..
  103.  
  104. All righty then!  Maybe the next question is WHY?  I dunno really, because
  105. it was there - or maybe it wasn't.  I've seen a few of these programs
  106. floating around for some time, but none of them held my attention for very
  107. long, as the responses calculated (assumed?) didn't appear too intelligent
  108. but rather more convoluted, and Deep Blue (the chess champion) is WAY outta
  109. my price range and also lacks personality.
  110.  
  111. In any case - the deed has been done.  At this time I consider Miggy to be
  112. capable of simple hello, goodbye, yes & no type conversations with little
  113. available data.  After some more time has been spent teaching it, Miggy's
  114. able to create better matches due to greater availablity of data and wider
  115. choice.  I would like to see its capabilities with a large (1+ meg)
  116. response file!
  117.  
  118.  
  119. STARTING MIGGY:
  120. ---------------
  121. Miggy is a CLI only program - there's no icon.  If you add an icon and
  122. start it then it's sure to crash as I didn't build it to be started that
  123. way.  Create a script that calls Miggy then start the script with an icon
  124. that calls C:IconX if you must have an icon for it.
  125.  
  126. From the CLI, type DH1:Miggy/Miggy, or wherever it lives.
  127.  
  128. It will load its MiggyText file, Dictionary and Response file.  You'll then
  129. be faced with a "->" prompt.  From here just type "Hello" for example, and
  130. you'll be on your way.
  131.  
  132.  
  133. The input parser knows only 2 commands:
  134.  
  135. "#l" - Enter "Learn" mode (See: TEACHING)
  136. "#q" - Quit
  137.  
  138. The maximum input length Miggy reads at any prompt is 75 characters.
  139.  
  140.  
  141. Total memory requirements are:
  142.  
  143. 8848 + Dictionary file length + Response file length.
  144.  
  145. The MiggyText file looks like this:
  146.  
  147. ---------------------------------------------------------------------------
  148.  
  149. Miggy V1.00 © Olly Koenders Australia 17-05-99.
  150. Loading reference files..
  151. Dictionary words: 
  152. Response records: 
  153. Learn mode activated - Type word/sentence to learn..
  154. Type 3 generic responses: 1st-Vague, 2nd-Semi coherent, 3rd-Understanding
  155. Learn mode deactivated.
  156. Match: 
  157. abcdefghijklmnopqrstuvwxyz';:>8^-()þ]}
  158. ABCDEFGHIJKLMNOPQRSTUVWXYZ';:>8^-()þ]}
  159.  
  160. ---------------------------------------------------------------------------
  161.  
  162. These lines can be edited to your liking/language.  I wonder if any lamers
  163. will put their own name at the top..?  There MUST be 10 lines and each line
  164. MUST end with a 0x0a/#10/linefeed or expect problems.
  165.  
  166.  
  167. THE INPUT PARSER:
  168. -----------------
  169. ..is the "->" prompt.  From here anything you type will be split into
  170. single words, and these characters:
  171.  
  172. abcdefghijklmnopqrstuvwxyz';:>8^-()þ]}
  173.  
  174. ..if found in the input will be changed into these:
  175.  
  176. ABCDEFGHIJKLMNOPQRSTUVWXYZ';:>8^-()þ]}
  177.  
  178. Any others will be masked so that only the characters from the second line
  179. will end up in the dictionary.  Typing "Hello,there!" will become
  180. "HELLO THERE " and entering "You're not" will become "YOU'RE NOT".  The
  181. format for these 2 lines must be:
  182.  
  183. lowercasecharactersinyourlanguage+anyothersyouwant
  184. UPPERCASECHARACTERSINYOURLANGUAGE+anyothersyouwant
  185.  
  186. All lowercase characters in the first line must correspond to the uppercase
  187. characters in the second.  The apostrophe "'" is there for words like
  188. "Can't" etc., and the others are for smileys. :)
  189.  
  190. Uppercasing the input words is essential as the computer sees "This" and
  191. "THIS" as 2 completely different things.
  192.  
  193. I recommend you don't add "!" or "?" as they are normally posted at the end
  194. of a word, and words like "YES" and "YES!" will end up in the Dictionary -
  195. they are the same thing.
  196.  
  197. Miggy will attempt to respond the best way it can determined by your input
  198. and the input of others from previous sessions.
  199.  
  200.  
  201. TEACHING:
  202. ---------
  203. Ok, in order to teach, we need to know how Miggy